<div id="venue_<?php echo $venueIndex; ?>_batch_<?php echo $batchIndex; ?>_groupdiscount">
    <?php
    $groupDiscount = CourseGroupDiscount::model()->findAllByAttributes(array('course_batche_id' => $batchId));
    $groupIndex = '';
    if (!empty($groupDiscount)) {
        for ($groupIndex = 0; $groupIndex < count($groupDiscount); $groupIndex++) {
            $discount = '';
            $inPercentage = '';
            $groupSize = '';
            $discount = $groupDiscount[$groupIndex]->discount_amount;
            $inPercentage = $groupDiscount[$groupIndex]->discount_in_percentage;
            $groupSize = $groupDiscount[$groupIndex]->group_size;
            ?>
            <div id="venue_<?php echo $venueIndex ?>_batch_<?php echo $batchIndex ?>_groupCount_<?php echo $groupIndex ?>">

                <div class="col-lg-3 col-md-3 col-sm-3 column4 course-pdl">
                    <input onchange="enableDisableGroupDiscountTextField(this.id);" name="GroupDiscount[CourseBatche][<?php echo $batchIndex ?>][ClassVenue][<?php echo $venueIndex ?>][discount_amount][]" id="class_venue_<?php echo $venueIndex ?>_classbatch_<?php echo $batchIndex ?>_group_discount_amount_<?php echo $groupIndex ?>" onblur="checkValueEmpty(this.id);" type="text" placeholder="Discount Amount" onkeypress="return isNumberKey(event)" class="<?php echo ($inPercentage != '') ? '' : 'requiredfield'; ?> field small" value="<?php echo $discount; ?>">
                    <div class="errorMessage" id="error_class_venue_<?php echo $venueIndex ?>_classbatch_<?php echo $batchIndex ?>_group_discount_amount_<?php echo $groupIndex ?>" style="display:none">Discount is required.</div>
                </div>

                <div class="col-lg-3 col-md-3 col-sm-3 column4 course-pdl">
                    <input onchange="enableDisableGroupDiscountTextField(this.id);" name="GroupDiscount[CourseBatche][<?php echo $batchIndex ?>][ClassVenue][<?php echo $venueIndex ?>][discount_in_percentage][]" id="class_venue_<?php echo $venueIndex ?>_classbatch_<?php echo $batchIndex ?>_group_in_percentage_<?php echo $groupIndex ?>" onblur="checkValueEmpty(this.id);" type="text" placeholder="Discount in percentage" onkeypress="return isNumberKey(event)" class="<?php echo ($discount != '') ? '' : 'requiredfield'; ?> field small" value="<?php echo $inPercentage; ?>">
                    <div class="errorMessage" id="error_class_venue_<?php echo $venueIndex ?>_classbatch_<?php echo $batchIndex ?>_group_in_percentage_<?php echo $groupIndex ?>" style="display:none">Amount is required.</div>
                </div>

                <div class="col-lg-3 col-md-3 col-sm-3 column4 course-pdl">
                    <input name="GroupDiscount[CourseBatche][<?php echo $batchIndex ?>][ClassVenue][<?php echo $venueIndex ?>][group_size][]" id="class_venue_<?php echo $venueIndex ?>_classbatch_<?php echo $batchIndex ?>_group_size_<?php echo $groupIndex ?>" type="text" placeholder="Group Size" onblur="checkValueEmpty(this.id)" onkeypress="return isNumberKey(event)" class="requiredfield field small"  value="<?php echo $groupSize; ?>">
                    <div class="errorMessage" id="error_class_venue_<?php echo $venueIndex ?>_classbatch_<?php echo $batchIndex ?>_group_size_<?php echo $groupIndex ?>" style="display:none">Group Size is required.</div>                
                </div>

                <div class="col-lg-3 col-md-3 col-sm-3 column4 course-pdl">
                    <a href="javascript:void(0)" id="venue_<?php echo $venueIndex ?>_batch_<?php echo $batchIndex ?>_groupRemove_<?php echo $groupIndex ?>" onclick="removeGroupDiscount(this.id);">-Remove</a></div>

            </div>


            <?php
        }
    }
    ?>
</div>
<div class="form-group">
    <div class="col-lg-3 col-md-3 col-sm-3 column3 add-disc course-pdl"><a href="javascript:void(0)" id="venue_<?php echo $venueIndex; ?>_batch_<?php echo $batchIndex; ?>_groupdiscount_<?php echo ($groupIndex == '') ? '0' : $groupIndex - 1; ?>" onclick="addGroupDiscount(this.id);">+ Add Group Discounts <?php if ($batchIndex == 0) { ?><em class="sprite question-sign" title="<?php echo Message::CLASS_BATCH_EARLY_DISCOUNT; ?>">&nbsp;</em> <?php } ?></a></p>
    </div>  
</div>
